Skip to content

Include traded_market_ids in Portfolio for reliable history loading#372

Merged
crthpl merged 2 commits intomainfrom
perf-traded-markets
Mar 8, 2026
Merged

Include traded_market_ids in Portfolio for reliable history loading#372
crthpl merged 2 commits intomainfrom
perf-traded-markets

Conversation

@crthpl
Copy link
Copy Markdown
Contributor

@crthpl crthpl commented Mar 8, 2026

Summary

  • The performance page previously only knew about markets from current portfolio exposure or already-loaded trades, missing closed positions and historical redemptions
  • Adds traded_market_ids field to the Portfolio proto, populated via a UNION query over trade and redemption tables during initial data send
  • Frontend stores these per-account and uses them to drive GetFullTradeHistory requests on the performance page
  • Also fixes redeem fee double-counting in per-market filtered PnL views (missed from Account for creation/redemption in performance page PnL #371)

Test plan

  • Open performance page for an account that has traded markets and closed positions — verify all traded markets appear
  • Redeem a fund, close the position, reload — verify the fund market still shows in performance
  • Filter to a single constituent market — verify redeem fees are not counted when the fund isn't in the filter

The performance page needs to know which markets an account has ever
traded/redeemed in order to request full trade history. Previously it
only discovered markets from current portfolio exposure or already-loaded
trades, missing closed positions and historical redemptions.

Add a `traded_market_ids` field to the Portfolio proto, populated from a
UNION query over trade and redemption tables during initial data send.
The frontend stores these per-account and uses them to drive
GetFullTradeHistory requests.

Also fixes redeem fee double-counting in per-market filtered PnL views.
@crthpl crthpl requested a review from a team as a code owner March 8, 2026 16:18
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
platform Ready Ready Preview, Comment Mar 8, 2026 4:39pm

Request Review

@crthpl crthpl merged commit b0f81aa into main Mar 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant